<template>
  <div class="box" style="position: relative">
    <el-tabs v-model="activeName" @tab-click="handleClick" class="demo-tabs" style="padding: 24px; width: 100%">
      <el-tab-pane label="治理规范" name="first">
        <gover ref="gover" v-if="isbool" />
      </el-tab-pane>
      <el-tab-pane label="模型规范" name="second">
        <model ref="mode" @chang="onModelFun" v-if="isbool1" />
      </el-tab-pane>
    </el-tabs>
    <div style="position: absolute" v-if="show">
      <div style="width: 100vw; position: relative">
        <modelzzc ref="idsmodel" @chang="offModelFun" @chang1="offModelFun1" />
      </div>
    </div>
  </div>
</template>

<script>
import { mapGetters, mapState } from 'vuex'

import model from './modelSpecificationList.vue'
import gover from './governanceNormsList.vue'
import Breadcrumb from '@/components/Breadcrumb'
import TopMenu from '@/layout/components/TopMenu/topMenu'
import modelzzc from './model.vue'
export default {
  name: 'ModelINdex',
  components: { model, gover, TopMenu, Breadcrumb, modelzzc },
  data() {
    return {
      show: false,
      activeName: 'first', //tarbar\
      row: {
        id: '',
      },
      isbool: true,
      isbool1: false,
    }
  },
  created() { },
  computed: {
    ...mapGetters(['sidebar', 'avatar', 'device']),
    ...mapState({
      topMenu: (state) => state.settings.topMenu,
    }),
    avatarUrl() {
      if (this.avatar === undefined) {
        return defaultAvatar
      }
      return this.avatar
    },
  },
  methods: {
    handleClick(tab, event) {
      if (tab.name == "first") {
        this.isbool = true
        this.isbool1 = false
      } else if (tab.name == "second") {
        this.isbool = false
        this.isbool1 = true
      }
    },
    onModelFun(e) {
      this.show = true
      this.row.id = e
    },
    offModelFun1() {
      this.show = false
    },
    offModelFun(item) {
      this.$refs.idsmodel.offids(item)

      this.show = false
    },
  },
}
</script>
<style lang="scss">
#treeBox {
  margin-top: 1px;

  .el-table thead {
    display: none;
  }
}

.el-dialog {
  width: 70% !important;
}

.box {
  width: 100%;
  height: 100%;

  display: flex;
}

.dome_left {
  height: 100%;
}

.dome_right {
  width: 88%;

  height: 100%;
}
</style>
